package cn.com.gdut.ppj.common.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.com.gdut.ppj.common.dao.ICandidateRecruitmentInfoDao;
import cn.com.gdut.ppj.common.service.ICommonService;
import cn.com.gdut.ppj.model.TbCandidateRecruitmentInfo;

@Service("commonService")
public class CommonServiceImpl implements ICommonService {
	
	@Resource private ICandidateRecruitmentInfoDao criDao;

	@Override
	public List<TbCandidateRecruitmentInfo> selectCandidateRecruitmentInfoByUserId(TbCandidateRecruitmentInfo info) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public TbCandidateRecruitmentInfo insertCandidateRecruitmentInfo(TbCandidateRecruitmentInfo info) {
		TbCandidateRecruitmentInfo tem = new TbCandidateRecruitmentInfo();
		tem.setRequirementId(info.getRequirementId());
		tem.setResumeId(info.getResumeId());
		List<TbCandidateRecruitmentInfo> list = criDao.selectCandidateRecruitmentInfoBy(tem);
		if(null != list && !list.isEmpty()){
			return null;
		}
		Integer result = criDao.insertCandidateRecruitmentInfo(info);
		if(result > 0){
			return info;
		}
		return null;
	}

	@Override
	public TbCandidateRecruitmentInfo updateCandidateRecruitmentInfoByCriId(TbCandidateRecruitmentInfo info) {
		// TODO Auto-generated method stub
		return null;
	}

}
